/**
 * 
 */
package com.juyu.miliao.authentication.controller;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import java.io.UnsupportedEncodingException;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * @author pengs
 *
 */
@RunWith(SpringRunner.class)
@SpringBootTest()
@AutoConfigureMockMvc
public class PhoneNumRegist {
	@Autowired
	private MockMvc mockMvc;
	
	@Test
	public void phoneRegist() throws UnsupportedEncodingException, Exception{
		MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
		params.add("username", "13064536242");
		params.add("password", "popops");
		params.add("nickName", "可就ai伦");
		params.add("sex", "1");
		params.add("icon", "xxx.jpg");
		params.add("phoneSystem", "1");
		params.add("versionNum", "test");
		mockMvc.perform(post("/register/phoneNumber").params(params)).andExpect(status().isOk());
		int a = 3;
	}
}
